package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourceMemberDataInfoMapper;
import com.ruoyi.db.domain.SourceMemberDataInfo;
import com.ruoyi.source.service.ISourceMemberDataInfoService;

/**
 * 线索用户资质信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceMemberDataInfoServiceImpl implements ISourceMemberDataInfoService 
{
    @Autowired
    private SourceMemberDataInfoMapper sourceMemberDataInfoMapper;

    /**
     * 查询线索用户资质信息
     * 
     * @param id 线索用户资质信息主键
     * @return 线索用户资质信息
     */
    @Override
    public SourceMemberDataInfo selectSourceMemberDataInfoById(Long id)
    {
        return sourceMemberDataInfoMapper.selectSourceMemberDataInfoById(id);
    }

    /**
     * 查询线索用户资质信息列表
     * 
     * @param sourceMemberDataInfo 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<SourceMemberDataInfo> selectSourceMemberDataInfoList(SourceMemberDataInfo sourceMemberDataInfo)
    {
        return sourceMemberDataInfoMapper.selectSourceMemberDataInfoList(sourceMemberDataInfo);
    }

    /**
     * 查询线索用户资质信息列表
     *
     * @param sourceMemberDataInfo 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<Map<String, Object>> selectSourceMemberDataInfoMapList(SourceMemberDataInfo sourceMemberDataInfo)
    {
        return sourceMemberDataInfoMapper.selectSourceMemberDataInfoMapList(sourceMemberDataInfo);
    }

    /**
     * 新增线索用户资质信息
     * 
     * @param sourceMemberDataInfo 线索用户资质信息
     * @return 结果
     */
    @Override
    public int insertSourceMemberDataInfo(SourceMemberDataInfo sourceMemberDataInfo)
    {
        sourceMemberDataInfo.setCreateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoMapper.insertSourceMemberDataInfo(sourceMemberDataInfo);
    }

    /**
     * 修改线索用户资质信息
     * 
     * @param sourceMemberDataInfo 线索用户资质信息
     * @return 结果
     */
    @Override
    public int updateSourceMemberDataInfo(SourceMemberDataInfo sourceMemberDataInfo)
    {
        sourceMemberDataInfo.setUpdateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoMapper.updateSourceMemberDataInfo(sourceMemberDataInfo);
    }

    /**
     * 批量删除线索用户资质信息
     * 
     * @param ids 需要删除的线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoByIds(Long[] ids)
    {
        return sourceMemberDataInfoMapper.deleteSourceMemberDataInfoByIds(ids);
    }

    /**
     * 删除线索用户资质信息信息
     * 
     * @param id 线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoById(Long id)
    {
        return sourceMemberDataInfoMapper.deleteSourceMemberDataInfoById(id);
    }
}
